package edu.xmut.kakamusic.viewmodel;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.List;

import edu.xmut.kakamusic.bean.entity.Pie;

public class PieViewModel extends ViewModel {
    private MutableLiveData<List<Pie>> pieList;
    public PieViewModel() {
        pieList = new MutableLiveData<>();
        String[] salaries = new String[]{"月薪6k-10k", "月薪10k-15k", "月薪15k-35k", "月薪100k+"};
        int[] percentage = {60, 20, 15, 5};
        List<Pie> value = new ArrayList<>();
        for (int i = 0; i < salaries.length; i++) {
            value.add(new Pie(salaries[i], percentage[i]));
        }
        pieList.setValue(value);
    }

    public LiveData<List<Pie>> getPieList() {
        return pieList;
    }


}
